/*
 * @Author: qiuziz
 * @Date: 2017-08-01 11:08:41
 * @Last Modified by: qiuziz
 * @Last Modified time: 2017-08-01 11:34:21
 */

 const responseFormat = (data = []) => {
    if (data.length < 1) return;
    const th = data[0], rows = data.slice(1);
    let formatData = [];
    rows.forEach((row, i) => {
      formatData[i] = {};
      row.forEach((col,index) => {
        formatData[i][th[index].toLowerCase()] = col;
      })
    })

    return formatData;
 }

 export {
   responseFormat
 }